// pages/come/come.js
function getPicFromcenavm(ctx){
  return new Promise(function(resolve,reject){
    ctx.takePhoto({
      quality:'low',
      success:(res)=>{
        getBase64(res.tempImagePath).then(function(res2){
          resolve(res2.data);
        });
      }
    })
  })
}
function getBase64(tempImagePath){
  return new Promise(function(resolve,reject){
    wx.getFileSystemManager().readFile({
      filePath:tempImagePath,
      encoding:"base64",
      success:function(data){
        resolve(data);
      }
    })
  })
}
//对外开放
module.exports={
  getPicFromcenavm:getPicFromcenavm
}